package com.webside.front.index.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.front.common.mapper.AdvertisementMapper;
import com.webside.front.common.mapper.BSeriesMapper;
import com.webside.front.common.mapper.BdictionaryMapper;
import com.webside.front.common.mapper.PBannerMapper;
import com.webside.front.common.mapper.SubjectMapper;
import com.webside.front.common.mapper.VideoFromWebMapper;
import com.webside.front.common.model.BSeries;
import com.webside.front.common.model.Bdictionary;
import com.webside.front.common.model.PBanner;
import com.webside.front.common.model.SubjectEntity;
import com.webside.front.common.model.VideoFromWeb;
import com.webside.front.index.service.IndexService;

@Service("indexService")
public class IndexServiceImpl implements IndexService {

	
	@Autowired
	private PBannerMapper pBannerMapper;
	@Autowired
	public BSeriesMapper bSerierdao;
	 @Autowired
	 private BdictionaryMapper bdictionaryMapper;
	 @Autowired
	 private AdvertisementMapper advertisementMapper;
	 @Autowired
	 private VideoFromWebMapper video;
	 @Autowired
	 private SubjectMapper subjectMapper;
	   
	 //收集资源表添加点赞次数
	 @Override
	 public Integer addLikeCount(VideoFromWeb videoFromWeb) {
		 // TODO Auto-generated method stub
		 return video.addLikeCount(videoFromWeb);
	 }
	 //收集资源表添加播放次数
	@Override
	public Integer addPlayCount(VideoFromWeb videoFromWeb) {
		// TODO Auto-generated method stub
		return video.addPlayCount(videoFromWeb);
	}
	/* 
		 * 电影
		 */ 
	@Override
	public List<Bdictionary> selectByPrimary(Bdictionary bdictionary) {
		
		return bdictionaryMapper.selectByPrimary(bdictionary);
	}
	/* 
	 * 电视剧
	 */ 
	@Override
	public List<Bdictionary> selectTVplay(Bdictionary bdictionary) {
		// TODO Auto-generated method stub
		return bdictionaryMapper.selectTVplay(bdictionary);
	}
	/* 
	 * 动漫
	 */ 
	@Override
	public List<Bdictionary> selectComic(Bdictionary bdictionary) {
		// TODO Auto-generated method stub
		return bdictionaryMapper.selectComic(bdictionary);
	}
	@Override
	public List<VideoFromWeb> queryByBind(Integer bindId,Integer id) {
		// TODO Auto-generated method stub
		return video.queryByBind(bindId,id);
	}
	// 查询全部
	@Override
	public List<PBanner> getAllSubject() {

		return pBannerMapper.getAllSubject();
	}
	@Override
	public VideoFromWeb selectVideoById(Long id) {
		// TODO Auto-generated method stub
		return video.selectVideoById(id);
	}
		//影迷力荐
		@Override
		public List<BSeries> selectByPrimaryALL() {
			 
			return bSerierdao.selectByPrimaryALL();
		}
		//猜你喜欢
		@Override
		public List<BSeries> selectByPrimarySelective(BSeries record) {
			 
			return bSerierdao.selectByPrimarySelective(record);
		}
		@Override
		public List<BSeries> selectByPrimaryTrailer(BSeries record) {
			return bSerierdao.selectByPrimaryTrailer(record);

		}
	 
	  
	 
		 //卫视同步
			 
			@Override
			public List<BSeries> selectByallSatellite(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectByallSatellite(record);
			}
		 
			@Override
			public List<BSeries> selectSatellite(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectSatellite(record);
			}
			//日韩热播
			//@Override
		  public List<BSeries> selectByKorea(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectByKorea(record);
			} 
			 
			@Override
			public List<BSeries> selectKorea(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectKorea(record);
			}

			 //美剧精选
		     
			@Override
			public List<BSeries> selectAmerican(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectAmerican(record);
			}
			 //佳品有约
			@Override
			public List<BSeries> selectJiapin(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectJiapin(record);
			}
			@Override
			public List<BSeries> selectByJiapin(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectByJiapin(record);
			}
			@Override
			public List<BSeries> selectByALLJiapin(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectByALLJiapin(record);
			}
			 //影院大片
			@Override
			public List<BSeries> selectCinema(BSeries record) {
				 
				return bSerierdao.selectCinema(record);
			}
			//动漫剧场
			@Override
			public List<BSeries> selectByAnimation(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectByAnimation(record);
			}
			@Override
			public List<BSeries> selectAnimation(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectAnimation(record);
			}
			 //电视剧榜
			@Override
			public List<BSeries> selectplay(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectplay(record);
			}
			@Override
			public List<BSeries> selectHomePlay(Map<String,Object> condition) {
				
				return bSerierdao.selectBSeriesByMapforType(condition);
			}
			 //佳品电视剧榜
			@Override
			public List<BSeries> selectJiapinplay(BSeries record) {
				// TODO Auto-generated method stub
				return bSerierdao.selectJiapinplay(record);
			}
			@Override
			public List<VideoFromWeb> selectTrailer() {
				// TODO Auto-generated method stub
				return video.selectByPrimaryTrailer();
			}
			@Override
			public List<BSeries> selectByTvplayALL() {
				// TODO Auto-generated method stub
				return bSerierdao.selectByTvplayALL();
			}
			@Override
			public List<BSeries> selectByLikeCount() {
				// TODO Auto-generated method stub
				return bSerierdao.selectByLikeCount();
			}
			//@Override
			public List<PBanner> getAllTarget() {
				// TODO Auto-generated method stub
				return pBannerMapper.getAllTarget();
			}
			@Override
			public List<Bdictionary> selectKeywords() {
				// TODO Auto-generated method stub
				return bdictionaryMapper.queryBdictionarysKeywords();
			}
			 
          
			@Override
			public List<HashMap<String,Object>> queryAdByAll(String date, String code) {
				// TODO Auto-generated method stub
				return advertisementMapper.queryAdByAll(date,code);
			}
			@Override
			public List<Bdictionary> selectPageInfo() {
				// TODO Auto-generated method stub
				return bdictionaryMapper.queryBdictionarysINDEX();
			}
			//shouye
			@Override
			public List<VideoFromWeb> selectReDianPlayFirst(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "INFORMATION");
				/*condition.put("type", "预告片");*/
				condition.put("recommendLevel","1");
				condition.put("pageSize", 6);
				List<VideoFromWeb> list= video.selectWebVideoByCondition(condition);
				
				return list;
			}
			@Override
			public List<VideoFromWeb> selectReDianPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "INFORMATION");
				/*condition.put("type", "预告片");*/
				condition.put("recommendLevel","2");
				condition.put("pageSize", 11);
				List<VideoFromWeb> list= video.selectWebVideoByCondition(condition);
				
				return list;
			}
			@Override
			public List<SubjectEntity> getSubjectList() {
				
				return subjectMapper.selectThreeSubject();
			}
			@Override
			public List<BSeries> selectTVPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "TVPLAY");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectGuoNeiTVPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "TVPLAY");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_DALU");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				return list;
			}
			@Override
			public List<BSeries> selectRiHanTVPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "TVPLAY");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_RIHAN");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectOuMeiTVPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "TVPLAY");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_OUMEI");
				condition.put("pageSize", 11);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<VideoFromWeb> selectHuaXuPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "TVPLAY");
				/*condition.put("type", "预告片");*/
				condition.put("recommendLevel","1");
				condition.put("status","PUBLISHED");
				condition.put("pageSize", 6);
				List<VideoFromWeb> list= video.selectWebVideoByCondition(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectMoviePlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "MOVIE");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectGuoNeiMoviePlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "MOVIE");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_DALU");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectRiHanMoviePlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "MOVIE");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_RIHAN");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectOuMeiMoviePlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "MOVIE");
				condition.put("recommendLevel","2");
				condition.put("area","AREA_OUMEI");
				condition.put("pageSize", 10);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<VideoFromWeb> selectYuGaoPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "MOVIE");
				/*condition.put("type", "预告片");*/
				condition.put("recommendLevel","1");
				condition.put("pageSize", 6);
				List<VideoFromWeb> list= video.selectWebVideoByCondition(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectVarityPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "VARITY");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectVarityPlayFirst(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "VARITY");
				condition.put("recommendLevel","1");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectVarityPlayBang(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "VARITY");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<VideoFromWeb> selectYuLePlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "VARITY");
				/*condition.put("type", "预告片");*/
				condition.put("recommendLevel","1");
				condition.put("pageSize", 6);
				List<VideoFromWeb> list= video.selectWebVideoByCondition(condition);
				
				return list;
			}
			
			@Override
			public List<BSeries> selectCartoonPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "CARTOON");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectCartoonPlayFirst(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "CARTOON");
				condition.put("recommendLevel","1");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
			@Override
			public List<BSeries> selectCartoonBangPlay(Map<String, Object> condition) {
				condition.clear();
				condition.put("channel", "CARTOON");
				condition.put("recommendLevel","2");
				condition.put("pageSize", 6);
				List<BSeries> list= bSerierdao.selectBSeriesByMapforType(condition);
				
				return list;
			}
}
